<?php

require_once("../config/netease_config.php");
require_once("tblog.class.php");

function netease_get_username($oauth_token, $oauth_token_secret)
{
	$tblog_obj = new TBlog(NETEASE_CONSUMER_KEY, NETEASE_CONSUMER_SECRET, 
		$oauth_token, $oauth_token_secret);
	
	$me = $tblog_obj->verify_credentials();
	
	return $me['name'];
}

function netease_add_weibo($oauth_token, $oauth_token_secret, $content)
{
	$tblog = new TBlog(NETEASE_CONSUMER_KEY, NETEASE_CONSUMER_SECRET, 
		$oauth_token, $oauth_token_secret);
	
	$ret = $tblog->update($content);
	return $ret;
}
?>